<#include "/main.ftl"/>
<@diamondNav/>

<body>
<div id="content-wrapper" style="margin-left: 13%">
    <div style="margin-top: 5%;margin-left: 1%;width: 100%">
        <#if projectShareNode.id??>
            <form action="/projectShareController/updateProjectShare"
        <#else >
             <form action="/projectShareController/addProjectShare"
        </#if>
                   method="post" id="myForm" class="form-horizontal" >
        <div class="form-group">
                <label for="host" class="control-label col-md-2">ip</label>
                <div class="col-md-3">
                <input class="form-control" name="ip" value="${projectShareNode.ip!}">
                </div>
        </div>
        <div class="form-group">
            <label for="host" class="control-label col-md-2">域名</label>
            <div class="col-md-3">
                <input class="form-control" name="domain" value="${projectShareNode.domain!}">
            </div>
        </div>
        <div class="form-group">
            <span style="margin-left: 17%;color: red;font-size: 20px">${errorMsg!}</span>
        </div>

        <div>
            <input name="pageName" type="hidden" value="ProjectHostPage">
            <input name="id" type="hidden" value="<#if projectShareNode??>${projectShareNode.id!}</#if>">
            <input name="hosts" id="hosts" type="hidden">
            <input name="shareType"  type="hidden" value="2">
            <input name="projectId" id="projectId" type="hidden"
                   value="${projectId!}">
        </div>
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <button type="button" class="btn btn-success " id="back">
                    返回
                </button>
                <button type="reset" class="btn btn-success ">
                    重置
                </button>
                <button type="submit" class="btn btn-success">
                    提交
                </button>
            </div>
        </div>
    </form>
    </div>
</div>
</body>

<script type="text/javascript">
    $("#back").click(function () {
        var projectId =$("#projectId").val();
        window.location.href = "/projectShareController/projectSharePage?shareType=2&projectId="+projectId;
    })
</script>